import { createRouter, createWebHistory } from 'vue-router'
import PkIndexView from '../views/PK/PkIndexView'
import RankListIndexView from '../views/RankList/RankListIndexView'
import RecordIndexView from '../views/Record/RecordIndexView'
import UserBotIndexView from '../views/User/Bot/UserBotIndexView'
import NotFound from '../views/ERROR/NotFound'

const routes = [
  {
    path: '/',
    name: 'home',
    redirect: '/pk/'
  },
  {
    path: '/pk/',
    name: 'pk_index',
    component: PkIndexView,
  },
  {
    path: '/ranklist/',
    name: 'ranklist_index',
    component: RankListIndexView,
  },
  {
    path: '/record/',
    name: 'record_index',
    component: RecordIndexView,
  },
  {
    path: '/user/bot/',
    name: 'user_bot_index',
    component: UserBotIndexView,
  },
  {
    path: '/404/',
    name: '404',
    component: NotFound,
  },
  {
    path: '/:catchAll(.*)',
    redirect: '/404/'
  },
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
